package com.example.demo;

import java.sql.Timestamp;
import java.util.Date;

import com.face.entity.Remark;
import com.face.entity.User;
import com.face.util.JsonUtil;

public class Tojson {
	public static void main(String[] args) {
		
		genRemark();
	}
	
	public void genUser(){
		User user = new User();
		user.setAge(1);
		user.setGender(0);
		Date now = new Date();
		user.setCreateTime(new Timestamp(now.getTime()));
		user.setCreator("wwb");
		user.setImgPath("http://baidu.com");		
		user.setIsDelete(0);
		user.setJob("教师");
		user.setShopId("7-eleven");
		user.setUpdateTime(new Timestamp(now.getTime()));
		user.setUsername("webwang");
	   
		String json="";
		try {
			json = JsonUtil.objectToJsonStr(user);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println(json);
	}
	
	public static void genRemark(){
		Remark remark = new Remark();
	    remark.setCreateTime(new Timestamp((new Date()).getTime()));
		remark.setCreator("webwang");
		remark.setDesc("desc");
		remark.setDetail("买飞机");
		remark.setUpdateTime(new Timestamp((new Date()).getTime()));
		remark.setUserId("1TqkFg9MdAM0_4o732V");
	    String json="";
		try {
			json = JsonUtil.objectToJsonStr(remark);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println(json);
	}

}
